package gov.mogaha.ntis.cmm.mob.law.util;

import gov.mogaha.ntis.cmm.mob.law.handler.CmmMobLawXmlHandler;

import java.io.StringReader;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.InputSource;

import android.util.Log;

public class CmmMobLawXmlUtil {
	
	public static void parseXml(String str, CmmMobLawXmlHandler handler){
		SAXParserFactory spf = SAXParserFactory.newInstance();
		SAXParser sp;		
		try{
			sp = spf.newSAXParser();
			InputSource is = new InputSource(new StringReader(str));
			sp.parse(is, handler);
		}catch(Exception e){
			Log.e(CmmMobLawStr._ERROR, "Class - XmlUtil / Message : " + e.getMessage());
		}
	}
}
